
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script src="__JS__/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="__JS__/jquery-ui-1.8.21.custom.min.js" type="text/javascript"></script>
    <!--<script src="__JS__/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>-->
    <!--<link rel="stylesheet" type="text/css" href="__CSS__/style.css" />-->
    <!--<link rel="stylesheet" type="text/css" href="__CSS__/page.css" />-->
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <!--<link href="__CSS__/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" />-->
    <style type="text/css">
        body
        {
            _width: 110%;
        }
    </style>
</head>
<body bgcolor="#d3d3d3">
<form action="">
    <input type="hidden" name="pagee" value="<{$pagee}>">
    用户名: <input class='uu' type="text" name="username" value="<{$username}>"> <br>
    昵称: <input type="text" name="nickname" value="<{$nickname}>"> <br>
    会员级别: <input type="checkbox" name="vip[]" value="1" {in name="1" value="$vip"}checked{/in} >vip1
              <input type="checkbox" name="vip[]" value="2" {in name="2" value="$vip"}checked{/in}>vip2
              <input type="checkbox" name="vip[]" value="3" {in name="3" value="$vip"}checked{/in}>vip3 <br>
    生日: <input type="date" name="birthday1" value="<{$birthday1}>">---<input type="date" name="birthday2" value="<{$birthday2}>"> <br>
    注册日期: <input type="date" name="reg_time1" value="<{$reg_time1}>">---<input type="date" name="reg_time2" value="<{$reg_time2}>"> <br>
    性别: <input type="radio" name="sex" value="1" {eq name="1" value="$sex"}checked{/eq}>男
    <input type="radio" name="sex" value="2" {eq name="2" value="$sex"}checked{/eq}>女
    <input type="radio" name="sex" value="3" {eq name="3" value="$sex"}checked{/eq}>全部 <br>
    <!--电话: <input type="text" name="" value=""> <br>-->
    <!--邮箱: <input type="text" name="" value=""> <br>-->
    是否有头像: <input type="checkbox" name="pic_url[]" value="1" {in name="1" value="$pic_url"}checked{/in}  >有
                <input type="checkbox" name="pic_url[]" value="2" {in name="2" value="$pic_url"}checked{/in} >无

<button>查询</button>
    <br><br> <br><br>




    <span style="margin-left:400px;color: red;display: none;font-size: 50px" id="m" >手机号修改成功</span>




</form>
    <table border="1">
        <tr bgcolor="silver">
            <td>选择</td>
            <td>id</td>
            <td>头像</td>
            <td>用户名</td>
            <td>昵称</td>
            <td>生日</td>
            <td>性别</td>
            <td>vip</td>
            <td>电话</td>
            <td>邮箱</td>
            <td><a href="<{:url('info',$get,'')}>">注册时间 <{$flag|default=''}></a></td>
            <td>个人简介</td>
            <td>验证</td>
            <td>操作</td>
        </tr>

        {volist name="list" id="v"}
        <tr bgcolor="#e0ffff">
            <td><input type="checkbox" name="id[]" value="<{$v.id}>"></td>
            <td><{$v['id']}></td>
            <td>
                <img src="/<{$v['pic_url']|default='default.gif'}>" alt="">
                <!--<img src="/upload/20191025/1b782b811260a4e1d4df514378c334aa.jpg" alt="">-->
            </td>
            <td><{$v['username']}></td>
            <td><{$v['nickname']}></td>
            <td><{$v['birthday']}></td>
            <td><{$v['sex']}></td>
            <td><{$v['vip']}></td>
            <td id="t<{$v['id']}>"><input type="text" value="<{$v['mobile']}>" id="d<{$v['id']}>" class="tel" idi="<{$v['id']}> " style="border:none;background:#e0ffff;" readonly /></td>
            <td><{$v['email']}></td>
            <td><{$v['reg_time']}></td>
            <td ><{$v['profiles']}></td>
            <td {eq name="v['status']" value="未激活"} style="color: red" {/eq} ><{$v['status']}></td>
            <td><a href="javascript:;" class="yan" idd="<{$v['id']}>"><{$v.status_name}></a>|<a href="<{:url('Login/edit_user',['id'=>$v['id'],input('get.')],'')}>">修改</a>  | <a href="<{:url('del',['id'=>$v['id'],input('get.')],'')}>">删除</a></td>
        </tr>
        {/volist}
   </table>
<a href="javascript:;" id="a"> 批量删除</a>

<{$list->render()}>
</body>



<script>
//双击修改电话号


    $('.tel').dblclick(function(){

        let tel=$(this);
        var tex=$(this).text();
        var id=$(this).attr('idi');
        $(this).removeAttr('readonly');
//        tel.remove();
//        $('#tid').append(" <input id='aa' class='qq' type='text' name='mobile' value="+tex+">");
        //失焦
        tel.blur(function(){
            var id=$(this).attr('idi');
            var texx=$(this).val();

            $.ajax({
                type:'post',
                url:"<{:url('Ajax/tel','','')}>",
                data:{'mobile':texx,'id':id},
                success:function(data){
                    console.log(data.id);
                if(data.id==1){
                    tel.css('color','green');

                    tel.html(" <td class='tel' idi='id'> "+texx+" </td>");
                    $("#m").show();
                    setTimeout(function(){
                        $('.tel').css('color','black');
                        $("#m").hide();
                    },3000)
                }
                },
                dataType:'json'
            });


        });
        //键盘
        tel.keydown(function(event){
            if(13==event.which){
                tel.blur();
            }
        })

    });


//单击激活
$('.yan').click(function(){
    var yan=$(this);
    var id=$(this).attr('idd');
    $.ajax({
        type:'post',
        url:"<{:url('Ajax/ajaxa','','')}>",
        data:{'status':$(this).text(),'id':id},

        success:function(data){
            if(data==0){
                yan.parent().prev().text('未激活').css('color','red');
                yan.text('激活');
          }
            if(data==1){
               yan.parent().prev().text('已激活').css('color','black');
               yan.text('关闭');
             }
        },
        dataType:'html'
    });
});














$('#a').click(function(){
    var arr6=[];
    $("input[name='id[]']").each(function(i,o){
        if($(o).prop("checked")){
            arr6.push($(o).val());
        }
    })
    var sp=arr6.join(",");
    console.log(sp);
    if(sp!=""){
        if(confirm("是否删除!")){
            location.href="<{:url('index/Index/del')}>?id="+sp;
        }
    }
})


</script>

</html>
